/**
 * nghilt
 * 2011/09/26
 */
package at.com.vn.chess.entity;

import javax.xml.bind.annotation.XmlAttribute;

import vn.nnn.shogi.quanco.QuanCo;
import at.com.vn.chess.util.Const;

/**
 *
 */
public class ChessInfo {
	private int x;
	private int y;
	private int color;
	private String name;
	private boolean isTB;

	public ChessInfo() {
		super();
		this.x = 0;
		this.y = 0;
		this.color = Const.UNDEFINE_VALUE;
		this.name = "";
		this.isTB = false;
	}

	public ChessInfo(QuanCo quanCo) {
		this.x = quanCo.getX();
		this.y = quanCo.getY();
		this.color = quanCo.color;
		this.name = quanCo.getClass().getSimpleName();
		this.isTB = quanCo.isTuBinh;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getColor() {
		return color;
	}

	public void setColor(int color) {
		this.color = color;
	}

	@XmlAttribute
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean getIsTB() {
		return isTB;
	}

	public void setIsTB(boolean isTB) {
		this.isTB = isTB;
	}

	@Override
	public String toString() {
		return "ChessInfo [x=" + x + ", y=" + y + ", color=" + color
				+ ", name=" + name + ", isTB=" + isTB + "]";
	}
}
